define(()=>{
    return function(goods, res, tbody){
        let str = "";
        // 遍历后端数据
        res.forEach(val1=>{
            // 遍历本地数据
            goods.forEach(val2=>{
                // 比对id
                if(val1.index === val2.id){
                    console.log(val1);
                    // 拼接页面结构
                    str+=`
                    <tr index="${val2.id}" class="cart_item">
                    <td><input type="checkbox" class="che"></td>
                    <td class="view">
                        <div class="view">
                            <a class="cart_item_pic" href="#">
                            <img src="${val1.bigImg}" alt="">
                            </a>
                            <a class="cart_item_link" href="#">${val1.title}
                            </a>
                            <p class="kind">${val1.number}</p>
                        </div>
                    </>
                    <td class="price">￥${val1.money}</td>
                    <td class="num"><input type="number" class="setNum" value="${val2.num}"></td>
                    <td class="sum">￥${val2.num * val1.money}</td>
                    <td ><input type="button" value="删除" class="delete" id="delete"></td>
                </tr>
                    `
                }
            })
        })
        tbody.html(str);
    }
   
})